API: Export gtk_container_snapshot_child()
authorBenjamin Otte <otte@redhat.com>
Tue, 20 Dec 2016 18:00:07 +0000 (19:00 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 20 Dec 2016 18:26:40 +0000 (19:26 +0100)
It's equivalent to gtk_container_propagate_draw() and then one is
public, too.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkcontainer.c
gtk/gtkcontainer.h
gtk/gtkcontainerprivate.h
gtk/gtknotebook.c

index 0fa2080efa40414f1ca8a1f61465d5aa963782f8..d6a9260dbb290424712a8fe799de8c12d68d5890 100644 (file)
@@ -735,6 +735,7 @@ gtk_container_child_notify
 gtk_container_child_notify_by_pspec
 gtk_container_forall
 gtk_container_propagate_draw
+gtk_container_snapshot_child
 gtk_container_get_focus_chain
 gtk_container_set_focus_chain
 gtk_container_unset_focus_chain
index 7db677a94241fc73dd9f8764f873a32d4a2b31f2..4f23ece952b7a6ececf12059391a65a714be42ef 100644 (file)
@@ -3269,6 +3269,26 @@ gtk_container_propagate_draw (GtkContainer *container,
   cairo_restore (cr);
 }
 
+/**
+ * gtk_container_snapshot_child:
+ * @container: a #GtkContainer
+ * @child: a child of @container
+ * @snapshot: $GtkSnapshot as passed to the container. In particular, no
+ *   calls to gtk_snapshot_translate_2d() should have been applied by the
+ *   parent.
+ *
+ * When a container receives a call to the snapshot function, it must send
+ * synthetic #GtkWidget::snapshot calls to all children. This function
+ * provides a convenient way of doing this. A container, when it receives
+ * a call to its #GtkWidget::snapshot function, calls
+ * gtk_container_snapshot_child() once for each child, passing in
+ * the @snapshot the container received.
+ *
+ * gtk_container_snapshot_child() takes care of translating the origin of
+ * @snapshot, and deciding whether the child needs to be snapshot. It is a
+ * convenient and optimized way of getting the same effect as calling
+ * gtk_widget_snapshot() on the child directly.
+ **/
 void
 gtk_container_snapshot_child (GtkContainer      *container,
                               GtkWidget         *child,
index 6725a80e25c468900ed7e25964efe3d5013bb85d..81c43342413c5fb22be2a455d6aaf97a25e57fc5 100644 (file)
@@ -142,6 +142,10 @@ GDK_AVAILABLE_IN_ALL
 void     gtk_container_propagate_draw   (GtkContainer   *container,
                                         GtkWidget      *child,
                                         cairo_t        *cr);
+GDK_AVAILABLE_IN_3_90
+void      gtk_container_snapshot_child (GtkContainer *container,
+                                        GtkWidget    *child,
+                                        GtkSnapshot  *snapshot);
 
 GDK_AVAILABLE_IN_ALL
 void     gtk_container_set_focus_chain  (GtkContainer   *container,
index c505d5542c370dfc67ad0a916b5606c45af1cbe6..a0569f2812d6d00fa9da8c8044cdc3d9bb7f0f89 100644 (file)
@@ -43,10 +43,6 @@ void      _gtk_container_maybe_start_idle_sizer (GtkContainer *container);
 void      gtk_container_get_children_clip       (GtkContainer  *container,
                                                  GtkAllocation *out_clip);
 
-void      gtk_container_snapshot_child          (GtkContainer  *container,
-                                                 GtkWidget     *child,
-                                                 GtkSnapshot   *snapshot);
-
 G_END_DECLS
 
 #endif /* __GTK_CONTAINER_PRIVATE_H__ */
index f03a15adb4745c1709c285ac3a9dfba37142a5e9..49e921210cea29731625910a26c46b7abcaa1a5d 100644 (file)
@@ -45,7 +45,6 @@
 #include "gtkwidgetpath.h"
 #include "gtkboxgadgetprivate.h"
 #include "gtkbuiltiniconprivate.h"
-#include "gtkcontainerprivate.h"
 #include "gtkcsscustomgadgetprivate.h"
 #include "gtkcssstylepropertyprivate.h"
 #include "gtksizerequest.h"